package cn.tedu.springbootdemo.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class Test {

    @Around("bean(userServiceImpl)")
    public Object test(ProceedingJoinPoint point) throws Throwable {
        long t1 = System.currentTimeMillis();
        Object proceed = point.proceed();
        long t2 = System.currentTimeMillis();
        System.out.println("测试时长为："+(t2-t1));
        return proceed;
    }
}
